package po;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;



@Entity
@Table(name="cust1")
public class Customer implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	@Id
	//@GeneratedValue(strategy=GenerationType.IDENTITY)
	
	@SequenceGenerator(name="my_seq",sequenceName="seq_john")
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="my_seq")
	
	private Integer id;
	@Column(length=12,nullable=false,unique=true)
	private String cname;
	
	private int age;
	@Column(columnDefinition="char(1)")
	private boolean sex;
	@Temporal(TemporalType.TIMESTAMP)
	private Date birth;
	
//	@Lob
//	@Basic(fetch=FetchType.LAZY)
//	private byte[] head;
	
	
	
	public Customer() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Customer(Integer id, String cname, int age) {
		super();
		this.id = id;
		this.cname = cname;
		this.age = age;
	}
	
	
	
	public Date getBirth() {
		return birth;
	}
	public void setBirth(Date birth) {
		this.birth = birth;
	}
	public boolean isSex() {
		return sex;
	}
	public void setSex(boolean sex) {
		this.sex = sex;
	}
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getCname() {
		return cname;
	}
	public void setCname(String cname) {
		this.cname = cname;
	}
	public int getAge() {
		
		
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	
	
}
